#ifndef PUBFUNC_H_
#define PUBFUNC_H_
#include <windows.h>

char * UTF_8ToGBK(char ** szGBK,char *strUtf8 ) 
{
	int len=MultiByteToWideChar(CP_UTF8, 0, (const char *)strUtf8, -1, NULL,0); 
	WCHAR * wszGBK = new WCHAR[len+1]; 
	memset(wszGBK, 0, len * 2 + 2); 
	MultiByteToWideChar(CP_UTF8, 0, (const char *)strUtf8, -1,wszGBK, len); 

	len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL); 
	*szGBK=new char[len + 1]; 
	memset(*szGBK, 0, len + 1); 
	WideCharToMultiByte (CP_ACP, 0, wszGBK, -1, *szGBK, len, NULL,NULL); 
 
	delete[] wszGBK; 
	return *szGBK;
}


#endif